<template>
  <div>
    <a-modal v-model:visible="showRejectModal" :title="t['确认']" :footer="false">
      <a-form :model="reasonForm" @submit-success="submit">
        <a-form-item :label="t['原因']" field="reason" required>
          <a-textarea v-model="reasonForm.reason"></a-textarea>
        </a-form-item>
        <a-form-item>
          <a-button type="primary" long html-type="submit"> {{ t["确定"] }} </a-button>
        </a-form-item>
      </a-form>
    </a-modal>
  </div>
</template>

<script setup lang="ts">
import { rejectLib } from "../../data/curd";
import { reasonForm, showRejectModal } from "./data";
const t = translate("公共模块");
const submit = () => {
  rejectLib(reasonForm.value);
  reasonForm.value = {
    reason: "",
    resId: ""
  };
  showRejectModal.value = false;
};
</script>

<style scoped lang="scss"></style>
